#define _GNU_SOURCE
#include <pthread.h>
#include "app_pool.h"
#include "log/log.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

int task_func(void *arg)
{
    char *data = (char *)arg;
    log_debug("task_func arg =%s,pid = %d", data, gettid());
    free(data);
}
// app_common_test
int main(int argc, char const *argv[])
{
    app_pool_init(5);
    for (int i = 0; i < 10; i++)
    {
        char *name = (char *)malloc(10);
        sprintf(name, "%s%d", "abcd", i);
        app_pool_registerTask(task_func, name);
        // free(name);
    }
    sleep(1);
    app_pool_close();
    return 0;
}
